<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.1.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">


<script id="hexo-configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    hostname: new URL('http://cconstantine.xyz').hostname,
    root: '/',
    scheme: 'Gemini',
    version: '7.6.0',
    exturl: false,
    sidebar: {"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},
    copycode: {"enable":false,"show_result":false,"style":null},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
    bookmark: {"enable":false,"color":"#222","save":"auto"},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    comments: {"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},
    algolia: {
      appID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    path: 'search.xml',
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}
  };
</script>

  <meta name="description" content="伪保姆级博客开设教程本文不涉及任何技术细节，别问，问就是我不知道。 不管白猫黑猫，能抓老鼠的就是好猫 。——Mr.Deng 我不曾了解轮子是如何制造的，只要他能转起来可以了。——克拉克 康斯坦丁(Clark Constantine) 没有一个计算机专业学生能拒绝拥有自己的博客，除非囊中羞涩没钱买服务器。 现在，我为大家提供一个免费搭建博客的方法。 可以先看看效果(不过我就瞎折腾了一下，真正更新就咕">
<meta property="og:type" content="article">
<meta property="og:title" content="伪保姆级博客开设教程">
<meta property="og:url" content="http:&#x2F;&#x2F;cconstantine.xyz&#x2F;2021&#x2F;09&#x2F;05&#x2F;%E4%BC%AA%E4%BF%9D%E5%A7%86%E7%BA%A7%E5%8D%9A%E5%AE%A2%E5%BC%80%E8%AE%BE%E6%95%99%E7%A8%8B&#x2F;index.html">
<meta property="og:site_name" content="Constantine&#39;s blog">
<meta property="og:description" content="伪保姆级博客开设教程本文不涉及任何技术细节，别问，问就是我不知道。 不管白猫黑猫，能抓老鼠的就是好猫 。——Mr.Deng 我不曾了解轮子是如何制造的，只要他能转起来可以了。——克拉克 康斯坦丁(Clark Constantine) 没有一个计算机专业学生能拒绝拥有自己的博客，除非囊中羞涩没钱买服务器。 现在，我为大家提供一个免费搭建博客的方法。 可以先看看效果(不过我就瞎折腾了一下，真正更新就咕">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https:&#x2F;&#x2F;note.youdao.com&#x2F;yws&#x2F;api&#x2F;personal&#x2F;file&#x2F;WEB21b5aec9bdc20561c980f7dc03dfb957?method&#x3D;download&amp;shareKey&#x3D;24e3345346d77491cbb8dc5dd6d657c3">
<meta property="og:image" content="https:&#x2F;&#x2F;note.youdao.com&#x2F;yws&#x2F;api&#x2F;personal&#x2F;file&#x2F;WEB74648d00178005426471753cb28d1139?method&#x3D;download&amp;shareKey&#x3D;47a74853ad9c6f6d5383c399b66a7f31">
<meta property="og:image" content="https:&#x2F;&#x2F;note.youdao.com&#x2F;yws&#x2F;api&#x2F;personal&#x2F;file&#x2F;WEB780047cf02634af584b35b1e645f1981?method&#x3D;download&amp;shareKey&#x3D;f928351ff85e6d5bb0e37f19e20b98a2">
<meta property="og:image" content="https:&#x2F;&#x2F;note.youdao.com&#x2F;yws&#x2F;api&#x2F;personal&#x2F;file&#x2F;WEB8486e52a1516097ecfc4a1da49738b00?method&#x3D;download&amp;shareKey&#x3D;3894280e4c986daf6e6864a0938f4baf">
<meta property="og:image" content="https:&#x2F;&#x2F;note.youdao.com&#x2F;yws&#x2F;api&#x2F;personal&#x2F;file&#x2F;WEBe02d2d1ba5979a0dd32aa45fc30eb886?method&#x3D;download&amp;shareKey&#x3D;7a17ec92e6402987f7ff4744f33ec30e">
<meta property="og:image" content="https:&#x2F;&#x2F;note.youdao.com&#x2F;yws&#x2F;api&#x2F;personal&#x2F;file&#x2F;WEBa8058f2552915c8cd8963ef6b3af3815?method&#x3D;download&amp;shareKey&#x3D;476125c2f9adac13c2babedf3af9c73c">
<meta property="og:image" content="https:&#x2F;&#x2F;note.youdao.com&#x2F;yws&#x2F;api&#x2F;personal&#x2F;file&#x2F;WEBbe3e517671e12a3a52877296e938e38e?method&#x3D;download&amp;shareKey&#x3D;25a4c62561c436b514445455a479a77d">
<meta property="og:image" content="https:&#x2F;&#x2F;note.youdao.com&#x2F;yws&#x2F;api&#x2F;personal&#x2F;file&#x2F;WEB2fe4aa4a566a213ff58dae1447cd4555?method&#x3D;download&amp;shareKey&#x3D;a3dc2c923d491f247faca5a5e42ab6f8">
<meta property="og:image" content="https:&#x2F;&#x2F;note.youdao.com&#x2F;yws&#x2F;api&#x2F;personal&#x2F;file&#x2F;WEB8e4b71c351743008fec8bc0296d6da9b?method&#x3D;download&amp;shareKey&#x3D;8fc8deade5c3364bce4d8a1be07657dc">
<meta property="og:image" content="https:&#x2F;&#x2F;note.youdao.com&#x2F;yws&#x2F;api&#x2F;personal&#x2F;file&#x2F;WEB5226d9dc370370f2fb28ae10e36a8c3f?method&#x3D;download&amp;shareKey&#x3D;a2bfce00c417fb9f2ca255866ab6bc9f">
<meta property="og:image" content="https:&#x2F;&#x2F;note.youdao.com&#x2F;yws&#x2F;api&#x2F;personal&#x2F;file&#x2F;WEB06475fd0cf5266ce4a911e7f346e7a76?method&#x3D;download&amp;shareKey&#x3D;0416781be8e94d9fe8a81b797e530778">
<meta property="og:image" content="https:&#x2F;&#x2F;note.youdao.com&#x2F;yws&#x2F;api&#x2F;personal&#x2F;file&#x2F;WEB8ec0551a947dd32b5cb53cf53ab6ebbe?method&#x3D;download&amp;shareKey&#x3D;1e8ae7a8e73dfa80d6a9472ed8cfc30f">
<meta property="article:published_time" content="2021-09-05T03:40:39.000Z">
<meta property="article:modified_time" content="2021-09-05T03:43:56.224Z">
<meta property="article:author" content="Constantine">
<meta property="article:tag" content="教程">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https:&#x2F;&#x2F;note.youdao.com&#x2F;yws&#x2F;api&#x2F;personal&#x2F;file&#x2F;WEB21b5aec9bdc20561c980f7dc03dfb957?method&#x3D;download&amp;shareKey&#x3D;24e3345346d77491cbb8dc5dd6d657c3">

<link rel="canonical" href="http://cconstantine.xyz/2021/09/05/%E4%BC%AA%E4%BF%9D%E5%A7%86%E7%BA%A7%E5%8D%9A%E5%AE%A2%E5%BC%80%E8%AE%BE%E6%95%99%E7%A8%8B/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true
  };
</script>

  <title>伪保姆级博客开设教程 | Constantine's blog</title>
  


  <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?4392ce32f2efc61a691258c585eaa24d";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-meta">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Constantine's blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
        <p class="site-subtitle">OI只能是兴趣</p>
  </div>

  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-fw fa-user"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>

</nav>
  <div class="site-search">
    <div class="popup search-popup">
    <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocorrect="off" autocapitalize="none"
           placeholder="搜索..." spellcheck="false"
           type="text" id="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result"></div>

</div>
<div class="search-pop-overlay"></div>

  </div>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

  <a href="https://github.com/clconstantine" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://cconstantine.xyz/2021/09/05/%E4%BC%AA%E4%BF%9D%E5%A7%86%E7%BA%A7%E5%8D%9A%E5%AE%A2%E5%BC%80%E8%AE%BE%E6%95%99%E7%A8%8B/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/huifeng.jpg">
      <meta itemprop="name" content="Constantine">
      <meta itemprop="description" content="XS的蒟蒻OIer">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Constantine's blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          伪保姆级博客开设教程
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2021-09-05 11:40:39 / 修改时间：11:43:56" itemprop="dateCreated datePublished" datetime="2021-09-05T11:40:39+08:00">2021-09-05</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E6%95%99%E7%A8%8B/" itemprop="url" rel="index">
                    <span itemprop="name">教程</span>
                  </a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="伪保姆级博客开设教程"><a href="#伪保姆级博客开设教程" class="headerlink" title="伪保姆级博客开设教程"></a>伪保姆级博客开设教程</h2><p><strong>本文不涉及任何技术细节，别问，问就是我不知道。</strong></p>
<p><em>不管白猫黑猫，能抓老鼠的就是好猫 。——Mr.Deng</em></p>
<p><em>我不曾了解轮子是如何制造的，只要他能转起来可以了。——克拉克 康斯坦丁(Clark Constantine)</em></p>
<p><del>没有一个计算机专业学生能拒绝拥有自己的博客，除非囊中羞涩没钱买服务器。</del></p>
<p>现在，我为大家提供一个免费搭建博客的方法。</p>
<p>可以先看看<a href="clconstantine.github.io">效果</a>(不过我就瞎折腾了一下，真正更新就咕咕咕咕咕了)</p>
<h4 id="必备工具"><a href="#必备工具" class="headerlink" title="必备工具"></a>必备工具</h4><a id="more"></a>
<ul>
<li>电脑</li>
<li><del>科学上网</del></li>
<li>会markdown的你(当然你会git &amp; node.js更好  <del>我也不会</del>)</li>
</ul>
<h4 id="准备工作"><a href="#准备工作" class="headerlink" title="准备工作"></a>准备工作</h4><ul>
<li><p>注册一个<a href="https://github.com/" target="_blank" rel="noopener">GitHub</a>账号</p>
<p><img src="https://note.youdao.com/yws/api/personal/file/WEB21b5aec9bdc20561c980f7dc03dfb957?method=download&amp;shareKey=24e3345346d77491cbb8dc5dd6d657c3" alt=""></p>
</li>
<li><p>根据自己情况安装<a href="http://nodejs.cn/download/" target="_blank" rel="noopener">node.js</a></p>
<p>这一步要自己解决哦，google bing baidu 等着你。</p>
<p>官方文档 <a href="https://nodejs.org/en/docs/" target="_blank" rel="noopener">en</a> <a href="http://nodejs.cn/learn" target="_blank" rel="noopener">cn</a></p>
</li>
<li><p>更新npm</p>
<p>打开cmd，输入</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install npm@latest -g</span><br></pre></td></tr></table></figure>
<p>等待更新完毕。</p>
<p>官方文档 <a href="https://docs.npmjs.com/" target="_blank" rel="noopener">en</a>  <a href="https://www.npmjs.cn/" target="_blank" rel="noopener">cn</a></p>
</li>
<li><p>根据电脑系统安装<a href="https://git-scm.com/download/win" target="_blank" rel="noopener">git</a> (以下使用以git for windows 为例 <del>用Linux的大佬自然可以不用看了，浪费巨巨您的时间</del>)</p>
<p>可以参考这篇<a href="https://www.cnblogs.com/xueweisuoyong/p/11914045.html" target="_blank" rel="noopener">博客</a>(你发现了嘛，google bing baidu 才是硬道理)</p>
</li>
</ul>
<h4 id="创建仓库"><a href="#创建仓库" class="headerlink" title="创建仓库"></a>创建仓库</h4><ul>
<li><p>登录github，点击右上角头像 <strong>旁边</strong> 的加号</p>
<p><img src="https://note.youdao.com/yws/api/personal/file/WEB74648d00178005426471753cb28d1139?method=download&amp;shareKey=47a74853ad9c6f6d5383c399b66a7f31" alt=""></p>
</li>
<li><p>点击 new repository</p>
</li>
</ul>
<p><img src="https://note.youdao.com/yws/api/personal/file/WEB780047cf02634af584b35b1e645f1981?method=download&amp;shareKey=f928351ff85e6d5bb0e37f19e20b98a2" alt=""></p>
<ul>
<li><p>在 repository name 中填入 <em>username.github.io</em>，其中username为你的用户名。</p>
<p>比如你叫的用户名为 <em>shenben</em>，就填入 <em>shenben.github.io</em> </p>
<p>然后创建。</p>
<p>注意：</p>
<ul>
<li>注册的邮箱记得验证</li>
<li>由于奇怪的原因，部分仓库创建后需要等待一段时间才会显示。</li>
</ul>
</li>
<li><p>创建完成后不用管跳出来的东西。</p>
</li>
</ul>
<h4 id="配置ssh-key"><a href="#配置ssh-key" class="headerlink" title="配置ssh key"></a>配置ssh key</h4><ul>
<li><p>既然是本地更新再传的网上，必然要和服务器连接，那如何让服务器知道你是你呢，这时ssh  key就派上用场了。</p>
</li>
<li><p>如果你之前没有用过ssh key ，打开cmd，输入</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh-keygen -t rsa -C &quot;你的邮箱&quot;</span><br></pre></td></tr></table></figure>
<p>记得把 <em>你的邮箱</em> 替换掉</p>
<p>然后打三个回车</p>
</li>
<li><p>如果你用过ssh key，可以跳过上一步。</p>
</li>
<li><p>上面一步最终会在你电脑的 <strong>用户目录</strong> 下生成一个.ssh的文件夹，打开后用 <strong>记事本等</strong> 方式打开 <em>id_rsa.pub</em>，复制。</p>
</li>
<li><p>进入github，点击右上角头像，进入settings -&gt;SSH and GPG keys -&gt;new SSH key</p>
</li>
</ul>
<p>  <img src="https://note.youdao.com/yws/api/personal/file/WEB8486e52a1516097ecfc4a1da49738b00?method=download&amp;shareKey=3894280e4c986daf6e6864a0938f4baf" alt="4"></p>
<p><img src="https://note.youdao.com/yws/api/personal/file/WEBe02d2d1ba5979a0dd32aa45fc30eb886?method=download&amp;shareKey=7a17ec92e6402987f7ff4744f33ec30e" alt="Inked5_LI"></p>
<ul>
<li>title随便编，把刚才复制的东西粘贴到key里，保存</li>
</ul>
<p><img src="https://note.youdao.com/yws/api/personal/file/WEBa8058f2552915c8cd8963ef6b3af3815?method=download&amp;shareKey=476125c2f9adac13c2babedf3af9c73c" alt="6"></p>
<ul>
<li>最后测试，输入</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh -T git@github.com</span><br></pre></td></tr></table></figure>
<pre><code>若出现
</code></pre><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Hi *********! You’ve successfully authenticated, but GitHub does not provide shell access.</span><br></pre></td></tr></table></figure>
<pre><code>的字样，则已经成功。
</code></pre><h4 id="用hexo生成博客"><a href="#用hexo生成博客" class="headerlink" title="用hexo生成博客"></a>用hexo生成博客</h4><ul>
<li><p>hexo时一个非常强大的博客发布工具，拥有众多插件与主题(theme)。</p>
<p><a href="https://hexo.io/" target="_blank" rel="noopener">官网</a> <a href="https://github.com/hexojs/hexo" target="_blank" rel="noopener">github官方</a></p>
</li>
<li><p>原理：</p>
<p>我只知道是保存静态文件，其他的咕咕咕咕咕咕咕。</p>
</li>
<li><p>注意：</p>
<ul>
<li>hexo版本更新较快，使用时不同主题时记得查看支持版本。</li>
<li>hexo 有两种 <em>_config.yml</em> 文件，一个再根目录下的全局 <em>_config.yml</em> ，一个在各种theme下。</li>
</ul>
</li>
<li><p>安装，打开cmd，输入</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install -g hexo</span><br></pre></td></tr></table></figure>
</li>
<li><p>在使用hexo之前，我们首先要学习几个简单的cmd命令</p>
<ul>
<li><p><em>cd</em> ：进入不同文件夹</p>
<p>e.g.      cd 新建文件夹        进入所在目录下的新建文件夹</p>
<pre><code>    cd ..              返回上一文件夹（返回父文件夹）
</code></pre></li>
<li><p><em>dir</em> ：查看某文件夹下的所有文件和文件夹。</p>
<p>e.g. <img src="https://note.youdao.com/yws/api/personal/file/WEBbe3e517671e12a3a52877296e938e38e?method=download&amp;shareKey=25a4c62561c436b514445455a479a77d" alt="7"></p>
</li>
<li><p>其他的······用的时候再查呗。</p>
</li>
</ul>
</li>
<li><p>找一个文件夹，比如在D盘新建一个文件夹 <em>我的blog</em> （建议还是英文路径，这里只是示范）</p>
<p><img src="https://note.youdao.com/yws/api/personal/file/WEB2fe4aa4a566a213ff58dae1447cd4555?method=download&amp;shareKey=a3dc2c923d491f247faca5a5e42ab6f8" alt="8"></p>
<p>打开cmd，进入该目录</p>
<p><img src="https://note.youdao.com/yws/api/personal/file/WEB8e4b71c351743008fec8bc0296d6da9b?method=download&amp;shareKey=8fc8deade5c3364bce4d8a1be07657dc" alt="9"></p>
<p>输入</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo init</span><br></pre></td></tr></table></figure>
<p>进行初始化，完成后出现下列文件。</p>
<p><img src="https://note.youdao.com/yws/api/personal/file/WEB5226d9dc370370f2fb28ae10e36a8c3f?method=download&amp;shareKey=a2bfce00c417fb9f2ca255866ab6bc9f" alt="10"></p>
</li>
<li><p>接下来介绍hexo的两个命令</p>
<p> <em>hexo g</em> ：生成网页文件。</p>
<p> <em>hexo s</em> ：启动本地预览服务，启动后用浏览器打开<a href="http://localhost:4000/" target="_blank" rel="noopener">http://localhost:4000</a>即可看到内容</p>
<pre><code>       （如果端口占用冲突，请参考google bing baidu ）ovo
</code></pre></li>
<li><p>我们试一下</p>
</li>
</ul>
<p><img src="https://note.youdao.com/yws/api/personal/file/WEB06475fd0cf5266ce4a911e7f346e7a76?method=download&amp;shareKey=0416781be8e94d9fe8a81b797e530778" alt="11"></p>
<p><img src="https://note.youdao.com/yws/api/personal/file/WEB8ec0551a947dd32b5cb53cf53ab6ebbe?method=download&amp;shareKey=1e8ae7a8e73dfa80d6a9472ed8cfc30f" alt="12"></p>
<ul>
<li>当然这是默认主题，修改主题属于进阶内容，暂时放一放。</li>
</ul>
<h4 id="部署博客"><a href="#部署博客" class="headerlink" title="部署博客"></a>部署博客</h4><ul>
<li><p>以上属于本地预览，我们要做的事请当然是上传到网上让大家访问。</p>
</li>
<li><p>在上传前，还需要在 <strong>根目录</strong> 中的 <em>_config.yml</em> 中配置deploy部分</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">deploy:</span><br><span class="line">type: git</span><br><span class="line">repository: git@github.com:username&#x2F;username.github.io.git</span><br><span class="line">branch: master</span><br></pre></td></tr></table></figure>
<p>记得把 <em>username</em> 换成你自己的用户名。</p>
</li>
<li><p>接下来安装一个插件</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-deployer-git --save</span><br></pre></td></tr></table></figure>
<p>请使用git bash执行上述安装命令。（你问我git bash在哪儿？桌面右键。）</p>
</li>
<li><p>在保证 <strong>ssh key</strong> ，<strong>deploy</strong>， <strong>插件</strong>安装完毕之后，打开cmd，执行</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo d</span><br></pre></td></tr></table></figure>
<p>即可上传成功。</p>
</li>
<li><p>接下来访问 <em>username.github.io</em> 就可以看到你的博客了。</p>
</li>
<li><p>绑定域名以及cdn加速属于进阶内容，暂时放一放。</p>
</li>
<li><p>以下为hexo常用命令</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">hexo new &quot;postName&quot; #新建文章</span><br><span class="line">hexo new page &quot;pageName&quot; #新建页面</span><br><span class="line">hexo generate #生成静态页面至public目录</span><br><span class="line">hexo server #开启预览访问端口（默认端口4000，&#39;ctrl + c&#39;关闭server）</span><br><span class="line">hexo deploy #部署到GitHub</span><br><span class="line">hexo help  # 查看帮助</span><br><span class="line">hexo version  #查看Hexo的版本</span><br><span class="line"></span><br><span class="line">缩写：</span><br><span class="line">hexo n &#x3D;&#x3D; hexo new</span><br><span class="line">hexo g &#x3D;&#x3D; hexo generate</span><br><span class="line">hexo s &#x3D;&#x3D; hexo server</span><br><span class="line">hexo d &#x3D;&#x3D; hexo deploy</span><br><span class="line"></span><br><span class="line">组合：</span><br><span class="line">hexo s -g #生成并本地预览</span><br><span class="line">hexo d -g #生成并上传</span><br></pre></td></tr></table></figure>
</li>
</ul>
<h4 id="更新文章"><a href="#更新文章" class="headerlink" title="更新文章"></a>更新文章</h4><ul>
<li><p>博客当然要有自己的文章了，接下来教大家如何更新文章。</p>
</li>
<li><p>首先还是打开cmd，cd进入博客根目录。</p>
</li>
<li><p>执行</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo new &quot;postname&quot;</span><br></pre></td></tr></table></figure>
<p>就可以新建文章，其中双引号不可省略，postname为文章标题，请随意。</p>
</li>
<li><p>生成的文件在根目录\source\_posts下，为.md文件。</p>
</li>
<li><p>md文件使用markdown语言编写。markdown是一门轻量级标记语言，它允许人们使用易读易写的纯文本格式编写文档。当前许多网站都广泛使用 Markdown 来撰写帮助文档或是用于论坛上发表消息。例如：GitHub、简书、reddit、Diaspora、Stack Exchange、OpenStreetMap 、SourceForge等。推荐大家使用typora进行编辑操作。</p>
</li>
<li><p>关于markdown的学习，网上一抓一大把，这里就不赘述了。</p>
</li>
<li><p>更新完文章后，别忘了生成并上传。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo d -g</span><br></pre></td></tr></table></figure>
</li>
<li><p>有时预览会发现文章太长，这时需要在文章恰当处添加</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&lt;!--more--&gt;</span><br></pre></td></tr></table></figure>
</li>
</ul>
<p>好了以上就是博客入门搭建了，希望大家折腾的开心。</p>
<p>作者：Constantine</p>

    </div>

    
    
    
        <div class="reward-container">
  <div>让我买点公式识别吧，金主爸爸！</div>
  <button disable="enable" onclick="var qr = document.getElementById(&quot;qr&quot;); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
    打赏
  </button>
  <div id="qr" style="display: none;">
      
      <div style="display: inline-block;">
        <img src="/images/wx.jpg" alt="Constantine 微信支付">
        <p>微信支付</p>
      </div>
      
      <div style="display: inline-block;">
        <img src="/images/ali.jpg" alt="Constantine 支付宝">
        <p>支付宝</p>
      </div>

  </div>
</div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/%E6%95%99%E7%A8%8B/" rel="tag"># 教程</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/03/15/c1847/" rel="prev" title="Comet OJ c1847">
      <i class="fa fa-chevron-left"></i> Comet OJ c1847
    </a></div>
      <div class="post-nav-item"></div>
    </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let activeClass = CONFIG.comments.activeClass;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#伪保姆级博客开设教程"><span class="nav-number">1.</span> <span class="nav-text">伪保姆级博客开设教程</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#必备工具"><span class="nav-number">1.0.1.</span> <span class="nav-text">必备工具</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#准备工作"><span class="nav-number">1.0.2.</span> <span class="nav-text">准备工作</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#创建仓库"><span class="nav-number">1.0.3.</span> <span class="nav-text">创建仓库</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#配置ssh-key"><span class="nav-number">1.0.4.</span> <span class="nav-text">配置ssh key</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#用hexo生成博客"><span class="nav-number">1.0.5.</span> <span class="nav-text">用hexo生成博客</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#部署博客"><span class="nav-number">1.0.6.</span> <span class="nav-text">部署博客</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#更新文章"><span class="nav-number">1.0.7.</span> <span class="nav-text">更新文章</span></a></li></ol></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Constantine"
      src="/images/huifeng.jpg">
  <p class="site-author-name" itemprop="name">Constantine</p>
  <div class="site-description" itemprop="description">XS的蒟蒻OIer</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">6</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">4</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">9</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

<div class="copyright">
  
  &copy; 2018 – 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Constantine</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v4.1.1
  </div>
  <span class="post-meta-divider">|</span>
  <div class="theme-info">主题 – <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> v7.6.0
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  

  

</body>
</html>
